﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Family_ImportFamilyInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void grade_DataBound(object sender, EventArgs e)
    {
        grade.Items.Insert(0, new ListItem("未选择", "0"));
    }
    protected void bj_DataBound(object sender, EventArgs e)
    {
        bj.Items.Insert(0, new ListItem("未选择", "0"));
    }
    protected void gvdata_Selected(object sender, SqlDataSourceStatusEventArgs e)
    {
        msg.Text = e.AffectedRows.ToString();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        try
        {
            int Value = 0;
            string Msg = "";

            System.Web.HttpPostedFile file = fu.PostedFile;

            if (file.ContentLength != 0)
            {
                XJX.Page.Helper.uploadExcel(file, out Value, out Msg);
                Response.Write("<script>alert('"+msg+"！')</script>");
            }
            else
            {
                Response.Write("<script>alert('没有指定导入的文件！')</script>");
            }
        }
        catch
        {
            fu.Dispose();
            Response.Write("<script>alert('导入家庭信息失败！')</script>");
        }
    }
}